<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed bg-cover" th:style="'background-image: url(/img/bianjibeijintu.jpeg)'">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
  <div th:replace="adminCommon::common-sidenav"></div>

  <div id="layoutSidenav_content">
    <main>
      <div class="container-fluid px-4">
        <h1 class="mt-4">编辑产品</h1>

        <ol class="breadcrumb mb-4">
          <li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
          <li class="breadcrumb-item"><a th:href="@{/product/selProduct}">产品管理</a></li>
          <li class="breadcrumb-item active">编辑产品</li>
        </ol>

        <div class="card mb-4 table">

          <form th:action="@{/product/updateProduct}" method="post">
            <div th:each="pdu:${productList}">
              <table class="table table-hover">
                <tr>
                  <td text-align="center">产品id：</td>
                  <td><input type="text" class="form-control" readonly="readonly"
                             th:value="${pdu.id}" name="id">
                  </td>
                </tr>
                <tr>
                  <td text-align="center">产品名称：</td>
                  <td><input type="text" class="form-control" th:value="${pdu.productName}"
                             name="productName"></td>
                </tr>
                <tr>
                  <td text-align="center">器材数量：</td>
                  <td><input type="text" class="form-control" readonly="readonly"
                             th:value="${pdu.deviceCount}" name="deviceCount">
                  </td>
                </tr>
                <tr>
                  <td text-align="center">产品型号：</td>
                  <td><input type="text" class="form-control" th:value="${pdu.productModel}"
                             name="productModel">
                  </td>
                </tr>
              </table>
              <div style="display:flex;justify-content:center;align-items:center;gap:20px;margin:30px 0;">
                <input type="submit" class="btn btn-outline-success" value="确认修改">
                <a th:href="@{/product/selProduct}" class="btn btn-secondary">
                  <i class="fas fa-arrow-left"></i> 返回
                </a>
              </div>
            </div>
          </form>
        </div>
      </div>
    </main>
    <footer th:replace="adminCommon::common-footer"></footer>
  </div>
</div>

<div th:include="adminCommon::common-scripts"></div>
</body>
</html>
